﻿using System;
using Metozis.Facade;

namespace Metozis.View
{
    public class OrderView
    {
        private IOrderFacade facade;
        public OrderView(IOrderFacade facade)
        {
            this.facade = facade;
        }
        public void Show(int invoiceId)
        {
            try
            {
                Order order = facade.GetOrderByInvoiceId(invoiceId);
                Console.WriteLine("{0}: {1}", order.InvoiceId, order.ProductName);
            }
            catch (Exception)
            {
                Console.WriteLine("Invalid invoice Id: {0}", invoiceId);
            }
            
        }
    }
}